﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TwitterThisWidget
{
    /// <summary>
    /// Interaction logic for TwitterThisView.xaml
    /// </summary>
    public partial class TwitterThisView : UserControl
    {
        public event EventHandler Tweet;

        public TwitterThisView()
        {
            InitializeComponent();
        }

        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
            OnTweet(new EventArgs());
            e.Handled = true;
        }

        protected virtual void OnTweet(EventArgs e)
        {
            if (Tweet != null)
            {
                Tweet(this, e);
            }
        }

        private void Grid_MouseEnter(object sender, MouseEventArgs e)
        {
            Mouse.OverrideCursor = Cursors.Hand;
        }

        private void Grid_MouseLeave(object sender, MouseEventArgs e)
        {
            Mouse.OverrideCursor = null;
        }
    }
}